package com.bjesc_b2c.app.appraiset.mvp.view.activity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.bjesc_b2c.app.appraiset.R;
import com.bjesc_b2c.app.appraiset.base.BaseActivity;
import com.bjesc_b2c.app.appraiset.http.IApiActivityRequest;
import com.bjesc_b2c.app.appraiset.utils.CustomSharedPreferences;
import com.bjesc_b2c.app.appraiset.widget.popupwindow.BasicDropDownPop;
import com.rxretrofit_build.CarPhotoID;
import com.rxretrofit_build.util.MapUtil;

import java.util.HashMap;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
import master_bean.CarBigPhotoStatusBean;
import rxretrofit_base.model.KeyBean;
import rxretrofit_base.model.ShowType;
import rxretrofit_base.model.TokenBean;
import rxretrofit_base.net.BaseSubscriber;
import rxretrofit_base.net.RxRequest;

/**
 * Created by Jason Chen on 2017/2/26.
 */

public class CarSurfaceItemActivity extends BaseActivity implements View.OnClickListener {
    @InjectView(R.id.tv_front_insurance_bar)
    TextView frontInsuranceBarTv;
    @InjectView(R.id.tv_among_net)
    TextView amongNetTv;
    @InjectView(R.id.tv_left_front_lamp)
    TextView leftFrontLampTv;
    @InjectView(R.id.tv_right_front_lamp)
    TextView rightFrontLampTv;
    @InjectView(R.id.tv_left_front_wheel)
    TextView leftFrontWheelTv;
    @InjectView(R.id.tv_right_front_wheel)
    TextView rightFrontWheelTv;
    @InjectView(R.id.tv_left_front_hub)
    TextView leftFrontHubTv;
    @InjectView(R.id.tv_right_front_hub)
    TextView rightFrontHubTv;
    @InjectView(R.id.tv_left_front_leaf)
    TextView leftFrontLeafTv;
    @InjectView(R.id.tv_right_front_leaf)
    TextView rightFrontLeafTv;
    @InjectView(R.id.tv_car_cover)
    TextView carCoverTv;
    @InjectView(R.id.tv_front_windshield)
    TextView frontWindshieldTv;
    @InjectView(R.id.tv_left_reflector)
    TextView leftReflectorTv;
    @InjectView(R.id.tv_right_reflector)
    TextView rightReflectorTv;
    @InjectView(R.id.tv_car_ceiling)
    TextView carCeilingTv;
    @InjectView(R.id.tv_left_front_windshield)
    TextView leftWindshieldTv;
    @InjectView(R.id.tv_right_front_windshield)
    TextView rightWindshieldTv;
    @InjectView(R.id.tv_left_front_door)
    TextView leftFrontDoorTv;
    @InjectView(R.id.tv_right_front_door)
    TextView rightFrontDoorTv;
    @InjectView(R.id.tv_left_rear_door)
    TextView leftRearDoorTv;
    @InjectView(R.id.tv_right_rear_door)
    TextView rightRearDoorTv;
    @InjectView(R.id.tv_left_footrest)
    TextView leftFootrestTv;
    @InjectView(R.id.tv_right_footrest)
    TextView rightFootrestTv;
    @InjectView(R.id.tv_left_area_windshield)
    TextView leftAreaWindshield;@InjectView(R.id.tv_right_area_windshield)
    TextView rightAreaWindshield;


    @InjectView(R.id.tv_after_windshield)
    TextView afterWindshieldTv;
    @InjectView(R.id.tv_after_car_cover)
    TextView afterCarCoverTv;
    @InjectView(R.id.tv_left_rear_hub)
    TextView leftRearHubTv;
    @InjectView(R.id.tv_right_rear_hub)
    TextView rightRearHubTv;
    @InjectView(R.id.tv_car_num)
    TextView carNumTv;
    @InjectView(R.id.tv_left_rear_lamp)
    TextView leftRearLampTv;
    @InjectView(R.id.tv_right_rear_lamp)
    TextView rightRearLampTv;
    @InjectView(R.id.tv_left_rear_leaf)
    TextView leftRearLeafTv;
    @InjectView(R.id.tv_right_rear_leaf)
    TextView rightRearLeafTv;
    @InjectView(R.id.tv_left_rear_wheel)
    TextView leftRearWheelTv;
    @InjectView(R.id.tv_right_rear_wheel)
    TextView rightRearWheelTv;
    @InjectView(R.id.tv_after_insurance_bar)
    TextView afterInsuranceBarTv;

    private final int startRequest = 88;
    private BasicDropDownPop basicPop;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_car_surface_item);
        ButterKnife.inject(this);
        basicPop = new BasicDropDownPop(this, this);
        getSurfaceStatus();
    }

    @OnClick({R.id.iv_return, R.id.tv_save_info, R.id.tv_front_insurance_bar, R.id.tv_among_net,
            R.id.tv_left_front_lamp, R.id.tv_right_front_lamp, R.id.tv_left_front_wheel,
            R.id.tv_right_front_wheel, R.id.tv_left_front_hub, R.id.tv_right_front_hub,
            R.id.tv_left_front_leaf, R.id.tv_right_front_leaf, R.id.tv_car_cover, R.id.tv_front_windshield,
            R.id.tv_left_reflector, R.id.tv_right_reflector, R.id.tv_car_ceiling, R.id.tv_left_front_windshield,
            R.id.tv_right_front_windshield, R.id.tv_left_front_door, R.id.tv_right_front_door,
            R.id.tv_left_rear_door, R.id.tv_right_rear_door, R.id.tv_left_footrest, R.id.tv_right_footrest,
            R.id.tv_after_windshield, R.id.tv_after_car_cover, R.id.tv_left_rear_hub, R.id.tv_right_rear_hub,
            R.id.tv_car_num, R.id.tv_left_rear_lamp, R.id.tv_right_rear_lamp, R.id.tv_left_rear_leaf,
            R.id.tv_right_rear_leaf, R.id.tv_left_rear_wheel, R.id.tv_right_rear_wheel,
            R.id.tv_after_insurance_bar, R.id.btn_previous_page, R.id.btn_next_page, R.id.rlty_title,
            R.id.tv_left_area_windshield, R.id.tv_right_area_windshield})
    public void onClick(View view) {
        Intent intent = new Intent(CarSurfaceItemActivity.this, SurfaceItemDetailActivity.class);
        switch (view.getId()) {
            case R.id.iv_return:        //返回
                finish();
                break;
            case R.id.tv_save_info:     //保存    //取消了
                break;
            case R.id.tv_front_insurance_bar:    //前保险杠
                intent = new Intent(CarSurfaceItemActivity.this, InsuranceBarDetailActivity.class);
                intent.putExtra("title", "前保险杠");
                intent.putExtra("sourceID", CarPhotoID.CarSurfaceID.frontInsuranceBar);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_among_net:     //中网
                buildIntent(intent, false, "中网", null, CarPhotoID.CarSurfaceID.amongNet);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_front_lamp:       //左前灯
                buildIntent(intent, false, "左前灯", "损坏", CarPhotoID.CarSurfaceID.leftFrontLamp);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_front_lamp:      //右前灯
                buildIntent(intent, false, "右前灯", "损坏", CarPhotoID.CarSurfaceID.rightFrontLamp);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_front_wheel:      //左前轮
                intent = new Intent(CarSurfaceItemActivity.this, CarTireScoreActivity.class);
                buildIntent(intent, true, "左前轮", "轮胎打分", CarPhotoID.CarSurfaceID.leftFrontWheel);
                startIntent(intent, false);
                break;
            case R.id.tv_right_front_wheel:     //右前轮
                intent = new Intent(CarSurfaceItemActivity.this, CarTireScoreActivity.class);
                buildIntent(intent, true, "右前轮", "轮胎打分", CarPhotoID.CarSurfaceID.rightFrontWheel);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_front_hub:        //左前轮毂
                buildIntent(intent, true, "左前轮毂", "划伤", CarPhotoID.CarSurfaceID.leftFrontHub);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_front_hub:       //右前轮毂
                buildIntent(intent, true, "右前轮毂", "划伤", CarPhotoID.CarSurfaceID.rightFrontHub);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_front_leaf:       //左前翼子板
                intent = buildInsuranceBarIntent(intent, "左前翼子板", CarPhotoID.CarSurfaceID.leftFrontLeaf);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_front_leaf:      //右前翼子板
                intent = buildInsuranceBarIntent(intent, "右前翼子板", CarPhotoID.CarSurfaceID.rightFrontLeaf);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_car_cover:             //机盖
                intent = buildInsuranceBarIntent(intent, "机盖", CarPhotoID.CarSurfaceID.cover);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_front_windshield:      //前挡风玻璃
                buildIntent(intent, false, "前挡风玻璃", null, CarPhotoID.CarSurfaceID.frontWindshield);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_reflector:        //左反光镜
                intent = new Intent(CarSurfaceItemActivity.this, CarrosserieDescribeActivity.class);
                buildIntent(intent, true, "曾更换", "破损", "划伤", "", "右反光镜", "", CarPhotoID.CarSurfaceID.leftReflector);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_reflector:       //右反光镜
                intent = new Intent(CarSurfaceItemActivity.this, CarrosserieDescribeActivity.class);
                buildIntent(intent, true, "曾更换", "破损", "划伤", "", "右反光镜", "", CarPhotoID.CarSurfaceID.rightReflector);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_car_ceiling:           //车顶
                intent = buildInsuranceBarIntent(intent, "车顶", CarPhotoID.CarSurfaceID.ceiling);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_front_windshield:       //左前车窗
                buildIntent(intent, false, "左前车窗", null, CarPhotoID.CarSurfaceID.leftFrontWindshield);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_front_windshield:      //右前车窗
                buildIntent(intent, false, "右前车窗", null, CarPhotoID.CarSurfaceID.rightFrontWindshield);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_area_windshield:       //左后车窗
                buildIntent(intent, false, "左后车窗", null, CarPhotoID.CarSurfaceID.leftAreaWindshield);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_area_windshield:      //右后车窗
                buildIntent(intent, false, "右后车窗", null, CarPhotoID.CarSurfaceID.rightAreaWindshield);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_front_door:       //左前门
                intent = buildInsuranceBarIntent(intent, "左前门", CarPhotoID.CarSurfaceID.leftFrontDoor);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_front_door:      //右前门

                intent = buildInsuranceBarIntent(intent, "右前门", CarPhotoID.CarSurfaceID.rightFrontDoor);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_rear_door:        //左后门

                intent = buildInsuranceBarIntent(intent, "左后门", CarPhotoID.CarSurfaceID.leftRearDoor);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_rear_door:       //右后门
                intent = buildInsuranceBarIntent(intent, "右后门", CarPhotoID.CarSurfaceID.rightRearDoor);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_footrest:         //左侧门槛

                intent = buildInsuranceBarIntent(intent, "左侧门槛", CarPhotoID.CarSurfaceID.leftFootrest);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_footrest:        //右侧门槛
                intent = buildInsuranceBarIntent(intent, "右侧门槛", CarPhotoID.CarSurfaceID.rightFootrest);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_after_windshield:      //后挡风玻璃
                buildIntent(intent, false, "后挡风玻璃", null, CarPhotoID.CarSurfaceID.afterWindshield);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_after_car_cover:       //后盖
                intent = buildInsuranceBarIntent(intent, "后盖", CarPhotoID.CarSurfaceID.afterCover);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_rear_hub:         //左后轮毂
                buildIntent(intent, true, "左后轮毂", "划伤", CarPhotoID.CarSurfaceID.leftRearHub);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_rear_hub:       //右后轮毂
                buildIntent(intent, true, "右后轮毂", "划伤", CarPhotoID.CarSurfaceID.rightRearHub);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_car_num:               //车牌    //取消了

                break;
            case R.id.tv_left_rear_lamp:        //左后灯
                buildIntent(intent, false, "左后灯", "损坏", CarPhotoID.CarSurfaceID.leftRearLamp);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_rear_lamp:       //右后灯
                buildIntent(intent, false, "右后灯", "损坏", CarPhotoID.CarSurfaceID.rightRearLamp);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_rear_leaf:        //左后翼子板
                intent = buildInsuranceBarIntent(intent, "左后翼子板", CarPhotoID.CarSurfaceID.leftRearLeaf);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_rear_leaf:       //右后翼子板
                intent = buildInsuranceBarIntent(intent, "右后翼子板", CarPhotoID.CarSurfaceID.rightRearLeaf);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_left_rear_wheel:       //左后轮
                intent = new Intent(CarSurfaceItemActivity.this, CarTireScoreActivity.class);
                buildIntent(intent, true, "左后轮", "轮胎打分", CarPhotoID.CarSurfaceID.leftRearWheel);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_right_rear_wheel:      //右后轮
                intent = new Intent(CarSurfaceItemActivity.this, CarTireScoreActivity.class);
                buildIntent(intent, true, "右后轮", "轮胎打分", CarPhotoID.CarSurfaceID.rightRearWheel);
                startIntent(intent, startRequest);
                break;
            case R.id.tv_after_insurance_bar:   //后保险杠
                intent = buildInsuranceBarIntent(intent, "后保险杠", CarPhotoID.CarSurfaceID.afterInsuranceBar);
                startIntent(intent, startRequest);
                break;
            case R.id.btn_previous_page:    //上一页
                startIntent(new Intent(CarSurfaceItemActivity.this, CarFrameworkImageActivity.class), true);
                break;
            case R.id.btn_next_page:        //下一页内饰
                startIntent(new Intent(CarSurfaceItemActivity.this, CarOrnamentsItemActivity.class), true);
                break;
            case R.id.rlty_car_form:        //车源图片
                startIntent(new Intent(CarSurfaceItemActivity.this, CarSourceActivity.class), true);
                break;
            case R.id.rlty_car_Framework:   //骨架
                startIntent(new Intent(CarSurfaceItemActivity.this, CarFrameworkImageActivity.class), true);
                break;
            case R.id.rlty_car_appearance:  //外观
                basicPop.dismiss();
                break;
            case R.id.rlty_car_interior:    //内饰
                startIntent(new Intent(CarSurfaceItemActivity.this, CarOrnamentsItemActivity.class), true);
                break;
            case R.id.rlty_car_damage:      //配置
                startIntent(new Intent(CarSurfaceItemActivity.this, DeviceActivity.class), true);
                break;
            case R.id.rlty_car_comprehensive:   //综合评估
                startIntent(new Intent(CarSurfaceItemActivity.this, ComprehensiveEvaluationActivity.class), true);
                break;
            case R.id.rlty_car_photo:       //合影
                startIntent(new Intent(CarSurfaceItemActivity.this, PhotographsActivity.class), true);
                break;
            case R.id.rlty_title:
                basicPop.showAsDropDown(findViewById(R.id.rlty_title));
                break;
        }
    }

    /**
     * 跳转页面需要带的参数
     *
     * @param intent
     * @param isScore        是否有选择项
     * @param scoreOneName   选项一的名称
     * @param scoreTwoName   选项二的名称
     * @param scoreThreeName 选项三的名称
     * @param scoreFourName  选项四的名称
     * @param title          标题
     * @param scoreTitle     选项的标题
     * @param sourceID       图片ID
     */
    private void buildIntent(Intent intent, boolean isScore, String scoreOneName,
                             String scoreTwoName, String scoreThreeName, String scoreFourName,
                             String title, String scoreTitle, String sourceID) {
        intent.putExtra("isScore", isScore);
        intent.putExtra("scoreOneName", scoreOneName);
        intent.putExtra("scoreTwoName", scoreTwoName);
        intent.putExtra("scoreThreeName", scoreThreeName);
        intent.putExtra("scoreFourName", scoreFourName);
        intent.putExtra("title", title);
        intent.putExtra("scoreTitle", scoreTitle);
        intent.putExtra("sourceID", sourceID);
        intent.putExtra("classID", CarPhotoID.surfaceID);
    }


    private Intent buildInsuranceBarIntent(Intent intent, String title, String sourceID) {
        intent = new Intent(CarSurfaceItemActivity.this, InsuranceBarDetailActivity.class);
        intent.putExtra("title", title);
        intent.putExtra("sourceID", sourceID);
        return intent;
    }

    private void getSurfaceStatus() {
        HashMap<String, Object> build = new MapUtil()
                .put("id", CustomSharedPreferences.getString(this, KeyBean.CARID.valueOf(), KeyBean.FILE_NAME.valueOf()))
                .put("class_id", CarPhotoID.surfaceID)
                .build();
        RxRequest.request(ShowType.SHOW, RxRequest.getClient(this, build).create(IApiActivityRequest.class).getFrameworkStatus(),
                new BaseSubscriber<TokenBean<List<CarBigPhotoStatusBean>>>(this) {
                    @Override
                    public void onSuccess(TokenBean<List<CarBigPhotoStatusBean>> o) {
                        if (o.getData() != null && o.getData().size() > 0) {
                            for (int i = 0; i < o.getData().size(); i++) {
                                judgmentStatus(o.getData().get(i).getAttr_id(), o.getData().get(i).getColor());
                            }

                        }
                    }

                    @Override
                    public void onFailure(Throwable e) {

                    }
                });
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == startRequest) {
            if (data != null) {
                judgmentStatus(data.getStringExtra("sourceID"), data.getStringExtra("color"));
            }
        }
    }

    /**
     * 跳转页面需要带的参数
     *
     * @param intent
     * @param isScore    是否有选择项
     * @param title      标题
     * @param scoreTitle 选项的标题
     * @param sourceID   图片ID
     */
    private void buildIntent(Intent intent, boolean isScore, String title, String scoreTitle, String sourceID) {
        intent.putExtra("isScore", isScore);
        intent.putExtra("title", title);
        intent.putExtra("scoreTitle", scoreTitle);
        intent.putExtra("sourceID", sourceID);
        intent.putExtra("classID", CarPhotoID.surfaceID);
    }

    /**
     * 设置1级状态状态
     *
     * @param v
     */
    private void changeGreenFrame(TextView v) {
        v.setTextColor(getResources().getColor(R.color.colorWhite));
        v.setBackgroundResource(R.color.colorFF33B16A);
    }

    /**
     * 设置2级状态状态
     *
     * @param v
     */
    private void changeYellowFrame(TextView v) {
        v.setTextColor(getResources().getColor(R.color.colorWhite));
        v.setBackgroundResource(R.color.colorFFF5A823);
    }

    /**
     * 设置3级状态状态
     *
     * @param v
     */
    private void changeOrangeFrame(TextView v) {
        v.setTextColor(getResources().getColor(R.color.colorWhite));
        v.setBackgroundResource(R.color.colorFFFF7900);
    }

    /**
     * 设置4级状态状态
     *
     * @param v
     */
    private void changeRadFrame(TextView v) {
        v.setTextColor(getResources().getColor(R.color.colorWhite));
        v.setBackgroundResource(R.color.colorFFF7041B);
    }

    /**
     * 取消状态
     *
     * @param v
     */
    private void changeWhiteFrame(TextView v) {
        v.setTextColor(getResources().getColor(R.color.colorFF030303));
        v.setBackgroundResource(R.drawable.shape_text_frame_bbbbbb);
    }

    /**
     * 设置控件状态
     *
     * @param view
     */
    private void setViewStatus(String level, TextView view) {
        if (TextUtils.isEmpty(level)) {
            return;
        }
        if ("green".equals(level)) {
            changeGreenFrame(view);
        } else if ("yellow".equals(level)) {

            changeYellowFrame(view);
        } else if ("orange".equals(level)) {

            changeOrangeFrame(view);
        } else if ("red".equals(level)) {
            changeRadFrame(view);
        } else {
//            changeWhiteFrame(view); //取消状态
            changeGreenFrame(view);
        }
    }

    /**
     * 判断哪些控件需要改变状态
     *
     * @param status 需要改变的ID
     */
    private void judgmentStatus(String status, String level) {
        if (TextUtils.isEmpty(status)) {
            return;
        }
        switch (status) {
            case CarPhotoID.CarSurfaceID.frontInsuranceBar:    //前保险杠
                setViewStatus(level, frontInsuranceBarTv);
                break;
            case CarPhotoID.CarSurfaceID.amongNet:     //中网
                setViewStatus(level, amongNetTv);
                break;
            case CarPhotoID.CarSurfaceID.leftFrontLamp:       //左前灯
                setViewStatus(level, leftFrontLampTv);
                break;
            case CarPhotoID.CarSurfaceID.rightFrontLamp:      //右前灯
                setViewStatus(level, rightFrontLampTv);
                break;
            case CarPhotoID.CarSurfaceID.leftFrontWheel:      //左前轮
                setViewStatus(level, leftFrontWheelTv);
                break;
            case CarPhotoID.CarSurfaceID.rightFrontWheel:     //右前轮
                setViewStatus(level, rightFrontWheelTv);
                break;
            case CarPhotoID.CarSurfaceID.leftFrontHub:        //左前轮毂
                setViewStatus(level, leftFrontHubTv);
                break;
            case CarPhotoID.CarSurfaceID.rightFrontHub:       //右前轮毂
                setViewStatus(level, rightFrontHubTv);
                break;
            case CarPhotoID.CarSurfaceID.leftFrontLeaf:       //左前翼子板
                setViewStatus(level, leftFrontLeafTv);
                break;
            case CarPhotoID.CarSurfaceID.rightFrontLeaf:      //右前翼子板
                setViewStatus(level, rightFrontLeafTv);
                break;
            case CarPhotoID.CarSurfaceID.cover:             //机盖
                setViewStatus(level, carCoverTv);
                break;
            case CarPhotoID.CarSurfaceID.frontWindshield:      //前档玻璃
                setViewStatus(level, frontWindshieldTv);
                break;
            case CarPhotoID.CarSurfaceID.leftReflector:        //左反光镜
                setViewStatus(level, leftReflectorTv);
                break;
            case CarPhotoID.CarSurfaceID.rightReflector:       //右反光镜
                setViewStatus(level, rightReflectorTv);
                break;
            case CarPhotoID.CarSurfaceID.ceiling:           //车顶
                setViewStatus(level, carCeilingTv);
                break;
            case CarPhotoID.CarSurfaceID.leftFrontWindshield:       //左前车窗
                setViewStatus(level, leftWindshieldTv);
                break;
            case CarPhotoID.CarSurfaceID.rightFrontWindshield:      //右前车窗
                setViewStatus(level, rightWindshieldTv);
                break;
            case CarPhotoID.CarSurfaceID.leftAreaWindshield:       //左后车窗
                setViewStatus(level, leftAreaWindshield);
                break;
            case CarPhotoID.CarSurfaceID.rightAreaWindshield:      //右后车窗
                setViewStatus(level, rightAreaWindshield);
                break;
            case CarPhotoID.CarSurfaceID.leftFrontDoor:       //左前门
                setViewStatus(level, leftFrontDoorTv);
                break;
            case CarPhotoID.CarSurfaceID.rightFrontDoor:      //右前门
                setViewStatus(level, rightFrontDoorTv);
                break;
            case CarPhotoID.CarSurfaceID.leftRearDoor:        //左后门
                setViewStatus(level, leftRearDoorTv);
                break;
            case CarPhotoID.CarSurfaceID.rightRearDoor:       //右后门
                setViewStatus(level, rightRearDoorTv);
                break;
            case CarPhotoID.CarSurfaceID.leftFootrest:         //左前侧脚踏板
                setViewStatus(level, leftFootrestTv);
                break;
            case CarPhotoID.CarSurfaceID.rightFootrest:        //右前侧脚踏板
                setViewStatus(level, rightFootrestTv);
                break;

            case CarPhotoID.CarSurfaceID.afterWindshield:      //后档玻璃
                setViewStatus(level, afterWindshieldTv);
                break;
            case CarPhotoID.CarSurfaceID.afterCover:       //后盖
                setViewStatus(level, afterCarCoverTv);
                break;
            case CarPhotoID.CarSurfaceID.leftRearHub:         //左后轮毂
                setViewStatus(level, leftRearHubTv);
                break;
            case CarPhotoID.CarSurfaceID.rightRearHub:       //右后轮毂
                setViewStatus(level, rightRearHubTv);
                break;
            case "car":               //车牌    //取消了

                break;
            case CarPhotoID.CarSurfaceID.leftRearLamp:        //左后灯
                setViewStatus(level, leftRearLampTv);
                break;
            case CarPhotoID.CarSurfaceID.rightRearLamp:       //右后灯
                setViewStatus(level, rightRearLampTv);
                break;
            case CarPhotoID.CarSurfaceID.leftRearLeaf:        //左后翼子板
                setViewStatus(level, leftRearLeafTv);
                break;
            case CarPhotoID.CarSurfaceID.rightRearLeaf:       //右后翼子板
                setViewStatus(level, rightRearLeafTv);
                break;
            case CarPhotoID.CarSurfaceID.leftRearWheel:       //左后轮
                setViewStatus(level, leftRearWheelTv);
                break;
            case CarPhotoID.CarSurfaceID.rightRearWheel:      //右后轮
                setViewStatus(level, rightRearWheelTv);
                break;
            case CarPhotoID.CarSurfaceID.afterInsuranceBar:   //后保险杠
                setViewStatus(level, afterInsuranceBarTv);
                break;
        }
    }
}
